package com.liangsui.mss.controller.system;

import com.liangsui.mss.dto.LoginInfoDto;
import com.liangsui.mss.service.LoginInfoService;
import com.liangsui.mss.vo.AjaxResult;
import com.liangsui.mss.vo.DataGridView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * LoginInfoController
 *
 * @author zhangjiawei
 * @email 1533167396@qq.com
 * @date 2022/12/5 13:54
 */
@RestController
@RequestMapping("system/loginInfo")
public class LoginInfoController {

    @Autowired
    private LoginInfoService LoginInfoService;

    /**
     * 功能描述: 分页查询操作日志
     */
    @GetMapping("listForPage")
    public AjaxResult listForPage(LoginInfoDto LoginInfoDto) {
        DataGridView gridView = LoginInfoService.listForPage(LoginInfoDto);
        return AjaxResult.success("查询成功", gridView.getData(), gridView.getTotal());
    }

    /**
     * 删除
     */
    @DeleteMapping("deleteLoginInfoByIds/{infoIds}")
    public AjaxResult deleteLoginInfoByIds(@PathVariable Long[] infoIds) {
        return AjaxResult.toAjax(this.LoginInfoService.deleteLoginInfoByIds(infoIds));
    }

    /**
     * 清空删除
     */
    @DeleteMapping("clearLoginInfo")
    public AjaxResult clearAllLoginInfo() {
        return AjaxResult.toAjax(this.LoginInfoService.clearLoginInfo());
    }
}
